Class TerminalLineImpl

java.lang.Object
com.cisco.pt.ipc.impl.IPCObjectImpl
com.cisco.pt.ipc.sim.impl.TerminalLineImpl
All Implemented Interfaces:
IPCObject, TerminalLine
Direct Known Subclasses:
ConsoleLineImpl, VirtualLineImpl

public class TerminalLineImpl extends IPCObjectImpl implements TerminalLine
Information provided by the PKI file:

    \class TerminalLine
    
    \brief TerminalLine manages the terminal lines, virtual terminal lines, and console lines.
    
    \example network().getDevice("Router0").getCommandLine()
    
Author:
Auto-generated
  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Information provided by the PKI file:
      
          \brief Returns the name of this terminal line.
          
          \return string, the name of this terminal line.
          
              
      Specified by:
      getName in interface TerminalLine
      Returns:
      String Returns a String
    • getOwnerDevice

      public Device getOwnerDevice()
      Information provided by the PKI file:
      
          \brief Returns the owner device of this terminal line.
          
          \return Device, the device that owns this terminal line.
          
              
      Specified by:
      getOwnerDevice in interface TerminalLine
      Returns:
      Device Returns a Device
    • getMode

      public String getMode()
      Information provided by the PKI file:
      
          \brief Returns the mode this terminal line is in.
          
          \return string, the mode this terminal line is in.
          
              
      Specified by:
      getMode in interface TerminalLine
      Returns:
      String Returns a String
    • getPrompt

      public String getPrompt()
      Information provided by the PKI file:
      
          \brief Returns the prompt of this terminal line.
          
          \return string, the prompt of this terminal line.
          
              
      Specified by:
      getPrompt in interface TerminalLine
      Returns:
      String Returns a String
    • getUserHistory

      public CommandHistory getUserHistory()
      Information provided by the PKI file:
      
          \brief Returns the user history of this terminal line.
          
          \return CommandHistory, the CommandHistory object.
          
              
      Specified by:
      getUserHistory in interface TerminalLine
      Returns:
      CommandHistory Returns a CommandHistory
    • getConfigHistory

      public CommandHistory getConfigHistory()
      Information provided by the PKI file:
      
          \brief Returns the config history of this terminal line.
          
          \return CommandHistory, the CommandHistory object.
          
              
      Specified by:
      getConfigHistory in interface TerminalLine
      Returns:
      CommandHistory Returns a CommandHistory
    • getCurrentHistory

      public CommandHistory getCurrentHistory()
      Information provided by the PKI file:
      
          \brief Returns the current history of this terminal line.
          
          \return CommandHistory, the CommandHistory object.
          
              
      Specified by:
      getCurrentHistory in interface TerminalLine
      Returns:
      CommandHistory Returns a CommandHistory
    • getHistorySize

      public int getHistorySize()
      Information provided by the PKI file:
      
          \brief Returns the history size.
          
          \return int, the history size.
          
              
      Specified by:
      getHistorySize in interface TerminalLine
      Returns:
      int Returns a int
    • getCommandInput

      public String getCommandInput()
      Information provided by the PKI file:
      
          \brief Returns the command input.
          
          \return string, the command input.
          
              
      Specified by:
      getCommandInput in interface TerminalLine
      Returns:
      String Returns a String
    • getTelnetClientCount

      public int getTelnetClientCount()
      Information provided by the PKI file:
      
          \brief Returns the number of telnet clients.
          
          \return int, the number of telnet clients.
          
              
      Specified by:
      getTelnetClientCount in interface TerminalLine
      Returns:
      int Returns a int
    • getTelnetClientAt

      public TelnetClientProcess getTelnetClientAt(int index)
      Information provided by the PKI file:
      
          \brief Returns the telnet client at the specified index.
          
          \param index, the index of the telnet client of interest.
          
          \return TelnetClientProcess, the TelnetClientProcess object at the specified index.
          
              
      Specified by:
      getTelnetClientAt in interface TerminalLine
      Parameters:
      index - Takes in a parameter of index
      Returns:
      TelnetClientProcess Returns a TelnetClientProcess
    • enterCommand

      public void enterCommand(String commandStr)
      Information provided by the PKI file:
      
          \brief Enters a command to the terminal line.
          
              
      Specified by:
      enterCommand in interface TerminalLine
      Parameters:
      commandStr - Takes in a parameter of commandStr
    • enterChar

      public void enterChar(Byte ascii, SpecialChar specialChar)
      Information provided by the PKI file:
      
          \brief Enters the specified ascii or special character into the terminal.
          
          \param ascii,       any ASCII character.
          Includes:   Backspace = 8
          Ctrl+C = 3
          Ctrl+Z = 26
          Ctrl+Shift+6 = 30
          Enter = 13
          Line Feed = 10
          Tab = 9
          Question = '?'
          Space = ' '
          Ctrl+B = 2
          Ctrl+F = 6
          Ctrl+P = 16
          Ctrl+N = 14
          Ctrl+A = 1
          Ctrl+E = 5
          Ctrl+U = 21
          \param SpecialChar, a special character key.
          Special characters: eNoChar = 0,
          eArrowRight = 1,
          eArrowLeft,
          eArrowUp,
          eArrowDown
          
          \remark If ascii is 0, then specialChar will be examined.
          
              
      Specified by:
      enterChar in interface TerminalLine
      Parameters:
      ascii - Takes in a parameter of ascii
      specialChar - Takes in a parameter of specialChar
    • setSettings

      public void setSettings(int speed, String bits, Parity parity, String stopbits, FlowControl flowcontrol)
      Information provided by the PKI file:
      
          \brief Sets the connection settings to this terminal
          
          \param int speed,   any Speed setting of either: 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200
          \param char bits,   The number of data bits, from 5 to 8, inclusive
          \param Parity parity, The parity mode, even, odd, none, mark, space
          \param string stopbits, The stop bits, 1, 1.5, or 2
          \param FlowControl flowcontrol, The flow control method, Xon/Xoff, Hardware, None
          
              
      Specified by:
      setSettings in interface TerminalLine
      Parameters:
      speed - Takes in a parameter of speed
      bits - Takes in a parameter of bits
      parity - Takes in a parameter of parity
      stopbits - Takes in a parameter of stopbits
      flowcontrol - Takes in a parameter of flowcontrol
    • getSpeed

      public int getSpeed()
      Information provided by the PKI file:
      
          This function gets the baud rate.
          
              
      Specified by:
      getSpeed in interface TerminalLine
      Returns:
      int Returns a int
    • getDataBits

      public Byte getDataBits()
      Information provided by the PKI file:
      
          This function gets the data bits.
          
              
      Specified by:
      getDataBits in interface TerminalLine
      Returns:
      Byte Returns a Byte
    • getParity

      public Parity getParity()
      Information provided by the PKI file:
      
          \param[in]          parity          a parity bit value
          
          This function sets the parity bit.
          
              
      Specified by:
      getParity in interface TerminalLine
      Returns:
      Parity Returns a Parity
    • getStopBits

      public String getStopBits()
      Information provided by the PKI file:
      
          This function gets the stop bits.
          
              
      Specified by:
      getStopBits in interface TerminalLine
      Returns:
      String Returns a String
    • getFlowControl

      public FlowControl getFlowControl()
      Information provided by the PKI file:
      
          This function gets the flow control.
          
              
      Specified by:
      getFlowControl in interface TerminalLine
      Returns:
      FlowControl Returns a FlowControl
    • println

      public void println(String output)
      Information provided by the PKI file:
      
          \brief This function gets the flow control.
          \param output, the output string to be printed to terminal line
          
              
      Specified by:
      println in interface TerminalLine
      Parameters:
      output - Takes in a parameter of output
    • flush

      public void flush(int lineCount)
      Information provided by the PKI file:
      
          \brief This function remove the first number of lines in the buffer
          \param lineCount, the number of lines to be removed
          
              
      Specified by:
      flush in interface TerminalLine
      Parameters:
      lineCount - Takes in a parameter of lineCount